﻿package Base.Net 
{
	import flash.events.*;
	
	/**
	 * ...
	 * @author fox
	 */
	public class NetEvent extends Event
	{
		public static const CLOSE:String = "NetEventClose";
		public static const CONNECT:String = "NetEventConnect";
		public static const ERROR:String = "NetEventError";
		
		public static var members:Object = new Object();
		
		public static function registerEvent( id:int , fun:Function ):void
		{
			members[ id ] = fun;
		}
		
		public static function unRegisterEvent( id:int ):void
		{
			members[ id ] = null;
		}
		
		// Constructor
		public function NetEvent ( type:String, bubbles:Boolean = false, cancelable:Boolean = false ) 
		{
			// Pass constructor parameters to the superclass constructor
			super( type, bubbles, cancelable );
		}
		
		// Every custom event class must override clone()
		public override function clone():Event
		{
			return new NetEvent( type, bubbles, cancelable );
		}
		
		public override function toString():String
		{
			return "NetEvent";
		}
		
	}
	
}